<!DOCTYPE html>
<html>
<head>
<title>Weiran ECMAScript Applications Framework</title>
<link rel=stylesheet type=text/css href=./style.css>
</head>

<body>

<div class=leftbar>
    <h1>Weiran</h1>
    <p>ECMAScript<br />Applications Framework</p>
    <p>Version: 1.2</p>
    <ul>
	<li><a href=Weiran.html>Weiran</a></li>
	<li><a href=Weiran.Array.html>Weiran.Array</a></li>
	<li><a href=Weiran.Buffer.html>Weiran.Buffer</a></li>
	<li><a href=Weiran.Class.html>Weiran.Class</a></li>
	<li>Weiran.Date<ul>
	    <li><a href=#Weiran.Date.format>Weiran.Date.format</a></li>
	    <li><a href=#Weiran.Date.doy>Weiran.Date.doy</a></li>
	</ul></li>
	<li><a href=Weiran.DB.html>Weiran.DB</a></li>
	<li><a href=Weiran.Event.html>Weiran.Event</a></li>
	<li><a href=Weiran.Events.html>Weiran.Events</a></li>
	<li><a href=Weiran.Function.html>Weiran.Function</a></li>
	<li><a href=Weiran.JSON.html>Weiran.JSON</a></li>
	<li><a href=Weiran.Lang.html>Weiran.Lang</a></li>
	<li><a href=Weiran.Number.html>Weiran.Number</a></li>
	<li><a href=Weiran.String.html>Weiran.String</a></li>
	<li><a href=Weiran.GRUB.html>GRUB Mechanism</a></li>
    </ul>
    <p>
        Copyright &copy; All<span>i</span>dylls<br />
        2011 - 2012
    </p>
</div>

<div class=content>

<div class=reftitle>Weiran.Date</div>
<p>Sub namespace contains convenience functions for date-time manipulation.</p>

<a name=Weiran.Date.format></a>
<h3><code>Weiran.Date.format(date, mask)</code></h3>
<p><b>Static method</b></p>
<p>
    <b>Parameters:</b><br />
    <span class=parameters>date</span> - <code>object</code>, instance of <code>Date</code><br />
    <span class=parameters>mask</span> - <code>string</code>, optional mask string
</p>
<p><b>Returns: </b><code>string</code></p>
<p>Returns a default formatted date-time string. If a mask is set, the format of mask will be used. Supported masks:</p>
<ul>
            <li>yy: short year, eg: 12</li>
            <li>yyyy: long year, eg: 2012</li>
            <li>m: short month, 0 - 12</li>
            <li>mm: long month, 00 - 12</li>
            <!--li>mmm: short literal month, eg: Mar</li>
            <li>mmmm: long literal month, eg: March</li-->
            <li>d: short day of month, 0 - 31</li>
            <li>dd: long day of month, 00 - 31</li>
            <!--li>ddd: short literal day of week, eg: Mon</li>
            <li>dddd: long literal day of week, eg: Monday</li-->
            <li>h: short hour, 0 - 11</li>
            <li>hh: 2-digit hour, 00-11</li>
            <li>H: short hour, 0 - 23</li>
            <li>HH: 2-digit hour, 00 - 23</li>
            <li>M: short minute, 0 - 59</li>
            <li>MM: 2-digit minute, 00 - 59</li>
            <li>S: short second, 0 - 59</li>
            <li>SS: 2-digit second, 00 - 59</li>
            <li>l: 2-digit millisecond, 00 - 99</li>
            <li>L: 3-digit millisecond, 000 - 999</li>
</ul>
<p>Examples:</p>
<p>
    &nbsp;&nbsp;<code>Weiran.Date.format(new Date()) // "Tue Mar 06 2012 10:24:55 GMT+0800 (CST)"</code><br />
    &nbsp;&nbsp;<code>Weiran.Date.format(new Date(), "dd/mm/yy") // "06/03/12"</code><br />
    &nbsp;&nbsp;<code>Weiran.Date.format(new Date(), "yyyy-mm-dd HH:MM:SS") // "2012-03-06 10:27:31"</code><br />
    &nbsp;&nbsp;<code>Weiran.Date.format(new Date(), "yyyy-mm-dd HH:MM:SS.L") // "2012-03-06 10:28:22.464"</code>
</p>

<a name=Weiran.Date.doy></a>
<h3><code>Weiran.Date.doy(date)</code></h3>
<p><b>Static method</b></p>
<p>
    <b>Parameters:</b><br />
    <span class=parameters>date</span> - <code>object</code>, instance of <code>Date</code>
</p>
<p><b>Returns: </b><code>number</code></p>
<p>Get day of the year of a date.</p>
</div>

</body>
</html>
